<?php
    session_start();
    if(!$_SESSION["user"]){
        header("Location: inicio.php");
    }
?>

<html><!-- InstanceBegin template="/Templates/main.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Erika Vilches</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {
	font-size: 11px;
	font-family: tahoma;
	color: #FFFFFF;
}
.style2 {
	color: #5e5e5e;
	font-size: 11px;
	font-family: tahoma;
}
.style3 {
	color: #FFFFFF;
	font-size: 10px;
	font-family: tahoma;
	font-weight: bold;
}
.style6 {
	color: #3b524b;
	font-size: 10px;
	font-family: tahoma;
	font-weight: bold;
}
.style10 {color: #A8B5B1}
.style11 {color: #FFFFFF}
.style12 {
	color: #65887D;
	font-weight: bold;
}
.style14 {
	color: #d0d9d6;
	font-size: 11px;
	font-family: tahoma;
}
.style15 {color: #D0D9D6}
.style16 {font-size: 11px; font-family: tahoma; color: #D0D9D6; }
.style19 {font-size: 11px; font-family: tahoma; color: #FFFFFF; font-weight: bold; }
.style20 {font-size: 8px}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>

<body bgcolor="#8D8D8F">
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr align="left" valign="top">
    <td width="50%" background="images/til_1.gif" style="background-repeat:repeat-x; background-position:top left ">&nbsp;</td>
    <td width="766" background="images/til_1.gif" style="background-repeat:repeat-x; background-position:top left "><script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0','width','766','height','144','src','Flash/header','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','Flash/header' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="766" height="144">
        <param name="movie" value="Flash/header.swf">
        <param name="quality" value="high">
        <embed src="Flash/header.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="766" height="144"></embed>
    </object></noscript></td>
    <td width="50%" background="images/til_1.gif" style="background-repeat:repeat-x; background-position:top left ">&nbsp;</td>
  </tr>
  <tr align="left" valign="top">
    <td width="50%" background="images/rep_1.gif" style="background-repeat:repeat-x; background-position:top ">&nbsp;</td>
    <td width="766" background="images/rep_1.gif" style="background-repeat:repeat-x; background-position:top "><div style="padding-left:40px; padding-top:0px">
      <table width="681"  border="0" cellspacing="0" cellpadding="0">
        <tr align="left" valign="top">
          <td width="189" height="100%"><!-- InstanceBeginEditable name="left" -->
            <table width="189" height="100%"  border="0" cellpadding="0" cellspacing="0" background="images/line_1.gif">
              <tr>
                <td height="23" align="left" valign="top"><img src="images/latecs_2.gif" width="189" height="23"></td>
              </tr>
              <tr>
                <td align="left" valign="top"><div style="padding-left:13px; padding-top:8px"><span class="style1"><strong><img src="images/point_1.gif" width="5" height="6" vspace="1"> Lorem <br>
                  </strong>Consectetuer</span></div>
                    <div style="padding-left:13px; padding-top:8px; padding-bottom:5px"><span class="style1"><strong><img src="images/point_1.gif" alt="" width="5" height="6" vspace="1"> Lorem <br>
                    </strong>Consectetuer. </span></div></td>
              </tr>
              <tr>
                <td height="21" align="left" valign="top"><img src="images/result.gif" width="187" height="21"></td>
              </tr>
              <tr>
                <td height="51" align="left" valign="top"><a href="#"><img src="images/clock.gif" width="187" height="60" border="0"></a></td>
              </tr>
              <tr>
                <td align="left" valign="top" style="background-repeat:no-repeat; background-position:bottom left "><div style="padding-left:13px; padding-top:8px; padding-bottom:5px"><span class="style1"> <strong><strong><img src="images/point_1.gif" width="5" height="6" vspace="1"></strong> Lorem </strong><br>
                  Praesent</span></div>
                    <div style="padding-left:13px; padding-top:8px; padding-bottom:5px"><span class="style1"> <strong><strong><img src="images/point_1.gif" width="5" height="6" vspace="1"></strong> Lorem</strong><br>
                      Praesent</span></div>
                  <div style="padding-left:13px; padding-top:8px; padding-bottom:5px"><span class="style1"> <strong><strong><img src="images/point_1.gif" width="5" height="6" vspace="1"></strong> Lorem</strong><br>
                    Praesent</span></div></td>
              </tr>
              <tr>
                <td align="left" valign="top" bgcolor="#EBEBEB"><img src="images/spacer.gif" width="1" height="2"></td>
              </tr>
            </table>
          <!-- InstanceEndEditable --></td>
          <td width="492" height="100%"><table width="492" height="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#EBEBEB">
            <tr>
              <td height="23" align="left" valign="top"><img src="images/some_of.gif" width="492" height="23"></td>
            </tr>
            <!-- InstanceBeginEditable name="main" -->
            <tr>
              <td height="100%" align="left" valign="top" background="images/line_5.gif"><table width="492" height="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#EBEBEB">
                <tr bgcolor="#EBEBEB">
                  <td align="left" valign="top" background="images/line_5.gif" class="style2" style="background-repeat:no-repeat; background-position:bottom left ">&nbsp;</td>
                </tr>
                <tr bgcolor="#EBEBEB">
                  <td align="left" valign="top" background="images/line_5.gif" class="style2" style="background-repeat:no-repeat; background-position:bottom left ">
                  
                  <td height="92" align="center"><h2>Modificar</h2>
                 <?php
	include('PHPFunctions/function_register.php');
		$value = $_POST['valor'];
		$date = $_POST["fecha"."$value"];
		$hour = $_POST["hora"."$value"];
		if(isset($_POST['modificar'])){
			echo "Modifica tu asesoria de: <strong>$date - $hour</strong><br />";
		}
	
	?>
     <br>
		<form action="modificar.php" method="post">
		<table align="center">
			<label for="day">Dia: </label>
			<select name="day">
			<?php
			for ($i = 0; $i <= 10; $i++){
                $date = $date = mktime(0,0,0, date("n"), date("j")+$i, date("Y"));
                $day = strftime("%Y-%m-%d", $date);
                if(strftime("%u", $date) != 6 and strftime("%u", $date) != 7){
				echo "<option>$day</option>";
                }
			}
			?>
			</select>
            <label for="horaN">Hora: </label>
			<select name="horaN">
			<?php
				for($i = 13; $i <=15; $i++){
					echo "<option>$i:00 </option>";
                    echo "<option>$i:30 </option>";
				}
			?>
			</select>
			<br /><label for="lugar">Lugar: </label>
            <select name="lugar">
                <option>Starbucks</option>
                <option>CCI</option>
                <option>Biblioteca</option>
                <option>Sala de Doctorantes</option>
            </select>
			<?php
			$date = $_POST["fecha"."$value"];
			$hour = $_POST["hora"."$value"];
			echo "<input type='hidden' name='fechaAnt' value=\"$date\" />";
			echo "<input type='hidden' name='horaAnt'  value=\"$hour\" />";
			?>
			
			<br /><br /><input type="submit" value="Modifica!" name="Modifica" />
			</form>
		</table>
     <br>
	
	
	<?php
	if(isset($_POST['Modifica'])){
			$prev_date = $_POST["fechaAnt"];
			$prev_hour = $_POST["horaAnt"];
			$new_date = $_POST["day"];
			$new_hour = $_POST["horaN"];
			$place = $_POST["lugar"];
			$user = $_SESSION["user"];
			modify_tutoring($prev_date, $prev_hour, $new_date, $new_hour, $place);
	}
		
	?>
     <br>
  <p><a href="menu.php"><span style="color: green;">Regresar</span></a></p>


&nbsp;</td>
                </tr>
                <tr bgcolor="#EBEBEB">
                  <td height="100%" align="left" valign="top">&nbsp;</td>
                </tr>
              </table></td>
            </tr>
            <!-- InstanceEndEditable -->
          </table></td>
          </tr>
      </table>
    </div></td>
    <td width="50%" background="images/rep_1.gif" style="background-repeat:repeat-x; background-position:top ">&nbsp;</td>
  </tr>
  <tr align="left" valign="top">
    <td width="50%">&nbsp;</td>
    <td width="766" height="100%"><div style="padding-left:40px; padding-top:0px">
      <table width="682"  border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="30" align="center" valign="top" background="images/back_bot.gif" style="background-position:top left; background-repeat:no-repeat "><div style="padding-left:0px; padding-top:5px"><a href="index.html" class="style19" style="text-decoration:none ">inicio</a><span class="style19"><span class="style20"><img src="images/spacer.gif" width="20" height="1">|<img src="images/spacer.gif" width="20" height="1"></span> </span><a href="acercade.html" class="style19" style="text-decoration:none ">acerca de</a><span class="style19"> <span class="style20"><img src="images/spacer.gif" width="20" height="1">|<img src="images/spacer.gif" width="20" height="1"></span> </span><a href="clases.html" class="style19" style="text-decoration:none ">clases</a><span class="style19"> <span class="style20"><img src="images/spacer.gif" width="20" height="1">|<img src="images/spacer.gif" width="20" height="1"></span> </span><a href="inicio.php" class="style19" style="text-decoration:none ">asesor&iacute;as</a><span class="style19"> <span class="style20"><img src="images/spacer.gif" width="20" height="1">|<img src="images/spacer.gif" width="20" height="1"></span> </span><a href="publicaciones.html" class="style19" style="text-decoration:none ">publicaciones</a><span class="style19"><span class="style20"><img src="images/spacer.gif" width="20" height="1">|<img src="images/spacer.gif" width="20" height="1"></span> </span><a href="contacto.php" class="style19" style="text-decoration:none ">contacto</a></div>
            <div style="padding-left:0px; padding-top:20px; color: #484747; font-size: 11px; font-family: tahoma;"><a href="index.html" style="color:#484747; text-decoration:none">Erika Vilches</a> &copy; 2008</div></td>
        </tr>
      </table>
    </div></td>
    <td width="50%">&nbsp;</td>
  </tr>
</table>
</body>
<!-- InstanceEnd --></html>
